import random
import sys

if __name__ == '__main__':
    args = sys.argv
    if len(args) == 1:
        r_len = 8
    else:
        r_len = int(args[1])

    r_dict = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVIXYZ"
    r_len %= len(r_dict) + 1
    print(''.join(random.sample(r_dict, r_len)))
